翻訳と辞書
Words near each other
・ Null (comics)
・ Null (computing)
・ Null (Foetus EP)
・ Null (Intronaut EP)
・ Null (mathematics)
・ Null (physics)
・ Null (radio)
・ Null (SQL)
・ Null allele
・ Null allomorph
・ Null and Void Ordinance
・ Null Bazaar
・ Null cell
・ Null character
・ Null cipher
Null coalescing operator
・ Null corrector
・ Null cycle
・ Null Device
・ Null device
・ Null distribution
・ Null dust solution
・ Null encryption
・ Null fill
・ Null function
・ Null graph
・ Null House
・ Null hypersurface
・ Null hypothesis
・ Null ideal


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Null coalescing operator : ウィキペディア英語版
Null coalescing operator
The null coalescing operator (called the Logical Defined-Or operator in Perl) is a binary operator that is part of the syntax for a basic conditional expression in several programming languages, including C#,〔(?? Operator (C# Reference) )〕 Perl as of version 5.10,〔(// Operator (Perl Reference) )〕 Swift.〔(Nil Coalescing Operator )〕 and PHP 7.0.0 〔(PHP 7.0.0 RC 7 Released )〕
In contrast to the ternary conditional if operator used as x ? x : y, but like the binary Elvis operator used as x ?: y, the null coalescing operator is a binary operator and thus evaluates its operands at most once, which is significant if the evaluation of x has side-effects.
==C#==

In C#, the null coalescing operator is ??. It is most often used to simplify null expressions as follows:

possiblyNullValue ?? valueIfNull

For example, if one wishes to implement some C# code to give a page a default title if none is present, one may use the following statement:
string pageTitle = suppliedTitle ?? "Default Title";
instead of the more verbose

string pageTitle = (suppliedTitle != null) ? suppliedTitle : "Default Title";

or

string pageTitle;
if (suppliedTitle != null)
pageTitle = suppliedTitle;
else
pageTitle = "Default Title";

The three forms are logically equivalent.
The operator can also be used multiple times in the same expression:

return some_Value ?? some_Value2 ?? some_Value3;

Once a non-null value is assigned to number, or it reaches the final value (which may or may not be null), the expression is completed.

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Null coalescing operator」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.